package com.cssw.fyzb.busi.service.user;

import com.cssw.fyzb.core.model.dodb.*;
import com.cssw.fyzb.core.model.vo.user.DistrictTreeNodeVo;
import com.cssw.fyzb.core.model.vo.user.SearchUserVo;
import com.cssw.fyzb.core.model.vo.user.UserForLiveVo;
import com.cssw.fyzb.core.model.mos.UserMo;
import com.ydn.dbframe.plugin.activerecord.Page;

import java.util.List;

/**
 * @author Feng Chen
 */
public interface UserService {

    Long save(Long supUserId, String mobile, String LoginPwd, String tradePwd);

    Long saveUnion(Long supUserId, String mobile, Integer sourceType, String openid, String nickName, String avatar, String loginPwd);

    Long saveQQ(Long supUserId, String mobile, String openid, String userName, String nickName, String province, String city, String sex, String avatar);

    Long saveWechat(Long supUserId, String mobile, String openid, String userName, String nickName, String province, String city, String sex, String avatar);

    User getById(Long userId);

    UserMo findById(Long userId);

    UserMo findByMobile(String mobile);

    //根据交易密码获取用户
    User getByTradePwd(Long userId, String tradePwd);

    //根据手机号密码获取用户
    User getByMobile(String mobile, String pwd);

    //根据手机号获取用户
    User getByMobile(String mobile);

    User getByImsi(String imsi);

    void updateImsi(Long userId, String imsi);

    // 2021.1.8 mongo 传mobile修改报错 分片不唯一 多传userId
    void updateLoginPwd(Long userId, String mobile, String loginPwd);

    // 2021.1.8 mongo 传mobile修改报错 分片不唯一 多传userId
    void updateTradePwd(Long userId, String mobile, String tradePwd);

    void updateAvatar(Long userId, String avatar);

    void updateNickName(Long userId, String nickname);

    void updateSex(Long userId, String sex);

    void updateStatus(Long userId, String status);

    void updateBirthday(Long userId, String birthday);

    void updateSign(Long userId, String sign);

    Page<User> listChild(Long userId, String keyword, String isAuth, Integer pageNumber, Integer pageSize);

    Page<User> pageUserFans(Long userId, Integer pageNumber, Integer pageSize);

    Page<User> pageUserFollow(Long userId, Integer pageNumber, Integer pageSize);

    Page<User> pageUserFriend(Long userId, Integer pageNumber, Integer pageSize);

    void updateFaceAuth(User user, String status);

    void updateFace(Long userId, String status);

    List<DistrictTreeNodeVo> getDistrictTree();

    void follow(Long userId, Long followUserId);

    void cancelFollow(Long userId, Long followUserId);

    void saveSendAuthFaceSucc(String orderNo, String nonce, String respCode, String respMsg, Long userId, String userName, String idNo);

    void saveSendAuthFaceFail(String orderNo, String nonce, String respCode, String respMsg, Long userId, String userName, String idNo);

    void saveQueryAuthFaceSucc(String orderNo, String nonce, String respCode, String respMsg, Long userId, String userName, String idNo);

    void saveQueryAuthFaceFail(String orderNo, String nonce, String respCode, String respMsg, Long userId, String userName, String idNo);

    TecentAuthFaceSend getTecentAuthFaceSend(Long userId, String orderNo);

    void saveAuthInfo(Long userId, String userName, String province, String city, String district, String idCard);

    boolean isFollow(Long userId, Long relUserId);

    Page<SearchUserVo> searchUser(Long userId, String key, Integer pageNumber, Integer pageSize);

    UserForLiveVo getUserForLive(Long userId, Long liveId, Long liveUserId);

    User getAuthUserById(String idCard);

    void saveCmfToken(Long userId, String token);

    /**
     * 实名认证存入
     *
     * @return
     * @Param
     **/
    void saveCmfUserAuth(String userName, String msg, Boolean status, Integer userId);

    CmfUserToken getCmfTokenByUserId(Long userId);

    void updateCmfToken(CmfUserToken userToken);

    /**
     * 更新省市区
     *
     * @return
     * @Param
     **/
    void updateCmfUser(CmfUser cmfUser);

    void syncUserToMongo(Long userId, String type);

    void syncUserToEs(Long userId, String type);
    //idcard是否重复
    User getIdCard(String idCard);

    //该主播是否发红包
    Integer hairRedPack(Long userId);

    /**
     * 保存认证日志
     * @param userId
     * @param userName
     * @param idCard
     * @param province
     * @param city
     * @param district
     */
    void saveAuthRecord(Long userId, String userName, String idCard, String province, String city, String district);

    List<AvatarPendantDef> listAvatarPendantDef();

    void updatePendantUrl(Long userId, Long pendantId);

    void updateFyNo(Long userId, Long fyNo);

    void resetPendantUrl(Long userId);

    void syncLikesToMongo(Long userId, String type);
}
